package com.bskj.kuaifu.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.bskj.common.web.BaseController;
import com.bskj.kuaifu.nettyService.service.LogicServer;

@Controller
@RequestMapping("page")
public class PageForwardController extends BaseController {
	@RequestMapping("{viewModule}/{pageName}")
	public ModelAndView page(@PathVariable String viewModule,
			@PathVariable String pageName) throws Exception {
		ModelAndView mv = getRequestModelAndView();
		mv.setViewName("/" + viewModule + "/" + pageName);
		return mv;
	}
	
	@ResponseBody
	@RequestMapping("startNettyService")
	public Map<String,Object> startService() throws Exception {
		Map<String,Object> resultMap = new HashMap<String, Object>();
		new LogicServer().start();
		resultMap.put("result", true);
		resultMap.put("msg", "启动成功");
		return resultMap;
	}
}
